package com.yunji.order.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.yunji.base.dto.PayoutFieldDTO;
import com.yunji.common.annotation.DataScope;
import com.yunji.order.domain.PayoutDO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Package com.yunji.order.mapper
 * FileName:	PayoutMapper.java
 * Copyright:	Copyright © 2024 云集互联 All Rights Reserved
 * Company:		云集互联
 * @version: 1.0
 * @since: JDK 1.8.0_202
 * Create at:   2024-04-21 21:29:25
 * Description:
 * 用户提现数据交互
 * Modification History:
 * Author					Date					Version         Description
 * -------------------------------------------------------------------------------------
 * HuaAo0803@163.com	2024-04-21 21:29:25     1.0             1.0 Version
 */
public interface IPayoutMapper extends MPJBaseMapper<PayoutDO> {

    @DataScope
    @Select({"<script>SELECT DISTINCT ${searchFiled} FROM t_payout p LEFT JOIN v3_belong b on p.belong_id = b.belong_id WHERE 1=1 ",
            "<if test='phone != null'>AND p.phone LIKE concat('%',#{phone},'%')</if>",
            "<if test='createName != null'>AND p.create_name LIKE concat('%',#{createName},'%')</if>",
            "<if test='userId != null'>AND p.user_id = #{userId}</if></script>"})
    List<String> searchTableField(PayoutFieldDTO param);
}